package com.huiminpay.transaction.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huiminpay.transaction.dto.PayChannelDTO;
import com.huiminpay.transaction.entity.PlatformChannel;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2019-11-15
 */
@Repository
public interface PlatformChannelMapper extends BaseMapper<PlatformChannel> {
    @Select("select" +
            "            pc.*" +
            "        FROM" +
            "            platform_channel pfc," +
            "            pay_channel pc," +
            "            platform_pay_channel ppc" +
            "        WHERE pfc.CHANNEL_CODE=ppc.PLATFORM_CHANNEL" +
            "          and ppc.PAY_CHANNEL=pc.CHANNEL_CODE" +
            "          and pfc.CHANNEL_CODE=#{channelCode}")
    List<PayChannelDTO> selectPayChannelByPlatformCode(String platformChannelCode);

}
